Skip to content

Conversation

@patrickfreyer
Copy link
Owner

Motivation

  • Prevent GPU memory buildup and visual jank when filters are applied or reset by ensuring flight route geometry and materials are properly disposed.
  • Make the loading overlay reflect actual texture load progress so the UI hides only when the globe is fully ready.
  • Improve runtime behavior on diverse devices by preferring appropriate renderer power, capping pixel ratio, and throttling animation on low-power devices.

Description

  • Add a clearFlightLines() helper in assets/js/earth.js that disposes geometries and materials and removes THREE.Line objects from the scene, and wire it into filter handlers by updating setupFilterHandlers to accept clearFlightLines and call it when filters are applied or reset.
  • Use a THREE.LoadingManager with the TextureLoader to hide the loading overlay only after all textures finish loading and replace the previous Promise-based texture handling with manager-driven hide timing.
  • Make renderer and rendering quality adaptive by detecting a deviceProfile and switching renderer.powerPreference, capping renderer.setPixelRatio, toggling features like clouds/night/glow, and throttling the animation loop with a frame-rate guard via quality.frameRate.
  • Make flight rendering configurable and cheaper on constrained devices by allowing createFlightPath to accept numPoints, createFlightLines to accept enableGlow, and by using lower-detail materials/segment counts when lowPowerMode is active.
  • Update flights.html to include a loading overlay (#earth-loading), a performance-pill badge, and refreshed filter panel markup and CSS (rounded cards, pills, collapsible state, and visual polish).

Testing

  • Launched a local static server with python -m http.server 8000 and it served successfully on port 8000.
  • Ran a Playwright script that opened http://127.0.0.1:8000/flights/ and saved a visual confirmation screenshot to artifacts/flights-3d.png (succeeded).
  • Attempted bundle exec jekyll build, which failed due to a missing Gemfile in this environment (failure unrelated to the JS/HTML changes).

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant